﻿Namespace Web
    Partial Public Class Nota

        Public Property strData As String
            Get
                Return Right("00" & Data.Day, 2) & "/" & Right("00" & Data.Month, 2) & "/" & Right("0000" & Data.Year, 4) '& " " & Right("00", Data.Hour) & ":" & Right("00", Data.Minute)
            End Get
            Set(value As String)
                Try
                    Data = Date.Parse(value)
                    RaisePropertyChanged("strData")
                Catch ex As Exception
                    Throw New FormatException()
                End Try
            End Set
        End Property

        Public ReadOnly Property Destinatari As String
            Get
                If Hostal Is Nothing And UsuariDesti Is Nothing Then
                    Return StringLibrary.TodosLosUsuarios
                ElseIf Hostal IsNot Nothing Then
                    Return Hostal.Nom
                Else
                    Return UsuariDesti.Nom
                End If
            End Get
        End Property

        Private Sub OnDataChanged()
            RaisePropertyChanged("strData")
        End Sub


    End Class
End Namespace